<?php
/**
 * The form for adding a new entry to the database.
 * @author Ian Dunn <scholar42@gmail.com>
 * @version 1.0
 * @since 2013-11-20
 */
require 'database.php';
require 'table.php';
require 'employees.php';
require 'materials.php';
require 'machines.php';
require 'customer.php';

$table = $_GET["type"];

loginInfo::update_login ();

?>

<html>
	<head>
<?php echo "\t\t<title> Opol - Add new " . ucwords($table) . "</title>\n"; ?>
	</head>
	<body>

		<link rel="stylesheet" type="text/css" href="opol.css">
		<?php require 'menu.php' ?>
		<br>
<?php

if (!strcmp ($table, 'employee')) {
	employee::display_form ('Employees');
} else if (!strcmp ($table, 'material')) {
	material::display_form ('Materials');
} else if (!strcmp ($table, 'machine')) {
	machine::display_form ('Machines');
} else if (!strcmp ($table, 'customer')) {
	customer::display_form ('Customer');
}
?>

	<body>
<html>
